From 586240d2f8ef5408c24b5636047487e844f309ee Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 20 Nov 2013 17:18:16 +0000 Subject: [PATCH] gdkwindow: Fix potential NULL pointer dereference MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gdk_window_ensure_native() can end up with a NULL parent pointer, which it passes to find_native_parent_above()…but that expects a non-NULL parent. Found with scan-build. https://bugzilla.gnome.org/show_bug.cgi?id=712760 --- gdk/gdkwindow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 9ab1f8a80d..a5174a75d0 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -1110,6 +1110,9 @@ find_native_sibling_above (GdkWindow *parent, { GdkWindow *w; + if (!parent) + return NULL; + w = find_native_sibling_above_helper (parent, child); if (w) return w; -- 2.30.2